-
Notifications
You must be signed in to change notification settings - Fork 379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(config): show more clear error message when config is not found #1606
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
const moduleName = "lingui" | ||
|
||
const configExplorer = cosmiconfigSync(moduleName, { | ||
searchPlaces: [ | ||
`${moduleName}.config.js`, | ||
`${moduleName}.config.cjs`, | ||
`${moduleName}.config.ts`, | ||
`${moduleName}.config.mjs`, | ||
"package.json", | ||
`.${moduleName}rc`, | ||
`.${moduleName}rc.json`, | ||
`.${moduleName}rc.yaml`, | ||
`.${moduleName}rc.yml`, | ||
`.${moduleName}rc.ts`, | ||
`.${moduleName}rc.js`, | ||
], | ||
loaders: { | ||
".js": JitiLoader(), | ||
".ts": JitiLoader(), | ||
".mjs": JitiLoader(), | ||
}, | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i read in the cosmiconfig docs that hey have a cache on the configExplorer instacne. Pulling creating this explorer out of the getConfig
function should help to leverage this cache.
size-limit report 📦
|
This comment was marked as outdated.
This comment was marked as outdated.
563b697
to
a4c98ad
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## next #1606 +/- ##
==========================================
+ Coverage 75.40% 75.45% +0.04%
==========================================
Files 77 77
Lines 1988 1992 +4
Branches 519 520 +1
==========================================
+ Hits 1499 1503 +4
Misses 375 375
Partials 114 114
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
Description
Discord conversation: https://discord.com/channels/974702239358783608/1088763465960787998/1089890861992661012
Currently, when lingui could not discover a config it just shows
No locales defined
, which is pretty confusing.This PR brings "Config not found" error message.
Types of changes
Fixes # (issue)
Checklist